package flag

import (
	sys_flag "flag"
)

type Option struct {
	Version bool
	DB      bool
}

func Parse() Option {
	version := sys_flag.Bool("v", false, "项目版本")
	db := sys_flag.Bool("db", false, "初始化数据库")

	sys_flag.Parse()
	return Option{
		Version: *version,
		DB:      *db,
	}

}

func IsWebStop(option Option) bool {
	if option.DB {
		return true
	}
	return false

}

func SwitchOption(option Option) {
	if option.DB {
		MakeMigrations()
	}

}
